// C06:6.1:if.cpp -- using the if statement
#include <iostream>

int main(void)
{
    using std::cout;
    using std::cin;
    char ch;
    int spaces = 0;
    int total = 0;
    cin.get(ch);
    while (ch != '.')
    {
        // check if ch is a space
        if (ch == ' ')
        {
            ++spaces;
        }
        ++total;
        cin.get(ch);
    }
    cout << spaces << " spaces, " << total;
    cout << " characters total in sentence\n";
}

